Skip to content

refactor!: "block" → "chunk" and "shard" → "block" - #216

Closed
bogovicj wants to merge 7 commits into
developmentfrom
refactor/shard-block-chunk
Closed

refactor!: "block" → "chunk" and "shard" → "block"#216
bogovicj wants to merge 7 commits into
developmentfrom
refactor/shard-block-chunk

Conversation

@bogovicj

Copy link
Copy Markdown
Contributor

So far affecting API methods but not classes

@bogovicj

bogovicj commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

Summary of public method name changes:

Old New
readBlock() readChunk()
readBlocks() readChunks()
writeBlock() writeChunk()
writeBlocks() writeChunks()
deleteBlock() deleteChunk()
deleteBlocks() deleteChunks()
- -
readShard() readBlock()
writeShard() writeBlock()
shardExists() blockExists()

A non-public method name change:

Old New
readBlockRecursive() readChunkRecursive()

New methods:

  • N5Writer.deleteBlock()
  • DatasetAttributes.getChunkSize()

Changes:

Any calls to (read/write)Chunk now need to call getChunkSize, not getBlockSize

@bogovicj

Copy link
Copy Markdown
Contributor Author

Re AbstractN5Test , I added this javadoc:

This class does not create sharded datasets. Its tests generally call read/writeBlock which are equivalent to read/writeChunk for the cases being tested here. The test {@link #testReadChunkVsBlock} checks that the equivalence between these methods holds.

I considered having the methods use read/writeChunk instead. Going forward with that, I'd want also to rename the test methods to use "chunk" instead of "block". Instead, I'm happy to use the generic term "block = chunk or shard" in these tests.

* getBlockSize should correspond to readBlock / writeBlock
* useful to have an analogue for readChunk / writeChunk
* that deletes blocks or chunks
* add clarifying javadoc
* test blockSize == chunkSize when not sharded
* fix block / chunk equivalence test and comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant